Integrand size = 29, antiderivative size = 108 \[ \int \cos (c+d x) (a+a \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=a^3 (3 A+B) x+\frac {a^3 (6 A+7 B) \text {arctanh}(\sin (c+d x))}{2 d}-\frac {5 a^3 B \sin (c+d x)}{2 d}+\frac {a B (a+a \sec (c+d x))^2 \sin (c+d x)}{2 d}+\frac {(A+2 B) \left (a^3+a^3 \sec (c+d x)\right ) \sin (c+d x)}{d} \]
[Out]
Time = 0.27 (sec) , antiderivative size = 108, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.103, Rules used = {4103, 4081, 3855} \[ \int \cos (c+d x) (a+a \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=\frac {a^3 (6 A+7 B) \text {arctanh}(\sin (c+d x))}{2 d}+\frac {(A+2 B) \sin (c+d x) \left (a^3 \sec (c+d x)+a^3\right )}{d}+a^3 x (3 A+B)-\frac {5 a^3 B \sin (c+d x)}{2 d}+\frac {a B \sin (c+d x) (a \sec (c+d x)+a)^2}{2 d} \]
[In]
[Out]
Rule 3855
Rule 4081
Rule 4103
Rubi steps \begin{align*} \text {integral}& = \frac {a B (a+a \sec (c+d x))^2 \sin (c+d x)}{2 d}+\frac {1}{2} \int \cos (c+d x) (a+a \sec (c+d x))^2 (a (2 A-B)+2 a (A+2 B) \sec (c+d x)) \, dx \\ & = \frac {a B (a+a \sec (c+d x))^2 \sin (c+d x)}{2 d}+\frac {(A+2 B) \left (a^3+a^3 \sec (c+d x)\right ) \sin (c+d x)}{d}+\frac {1}{2} \int \cos (c+d x) (a+a \sec (c+d x)) \left (-5 a^2 B+a^2 (6 A+7 B) \sec (c+d x)\right ) \, dx \\ & = -\frac {5 a^3 B \sin (c+d x)}{2 d}+\frac {a B (a+a \sec (c+d x))^2 \sin (c+d x)}{2 d}+\frac {(A+2 B) \left (a^3+a^3 \sec (c+d x)\right ) \sin (c+d x)}{d}-\frac {1}{2} \int \left (-2 a^3 (3 A+B)-a^3 (6 A+7 B) \sec (c+d x)\right ) \, dx \\ & = a^3 (3 A+B) x-\frac {5 a^3 B \sin (c+d x)}{2 d}+\frac {a B (a+a \sec (c+d x))^2 \sin (c+d x)}{2 d}+\frac {(A+2 B) \left (a^3+a^3 \sec (c+d x)\right ) \sin (c+d x)}{d}+\frac {1}{2} \left (a^3 (6 A+7 B)\right ) \int \sec (c+d x) \, dx \\ & = a^3 (3 A+B) x+\frac {a^3 (6 A+7 B) \text {arctanh}(\sin (c+d x))}{2 d}-\frac {5 a^3 B \sin (c+d x)}{2 d}+\frac {a B (a+a \sec (c+d x))^2 \sin (c+d x)}{2 d}+\frac {(A+2 B) \left (a^3+a^3 \sec (c+d x)\right ) \sin (c+d x)}{d} \\ \end{align*}
Leaf count is larger than twice the leaf count of optimal. \(335\) vs. \(2(108)=216\).
Time = 3.53 (sec) , antiderivative size = 335, normalized size of antiderivative = 3.10 \[ \int \cos (c+d x) (a+a \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=\frac {a^3 \cos ^4(c+d x) \sec ^6\left (\frac {1}{2} (c+d x)\right ) (1+\sec (c+d x))^3 (A+B \sec (c+d x)) \left (4 (3 A+B) x-\frac {2 (6 A+7 B) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}{d}+\frac {2 (6 A+7 B) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}{d}+\frac {4 A \cos (d x) \sin (c)}{d}+\frac {4 A \cos (c) \sin (d x)}{d}+\frac {B}{d \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {4 (A+3 B) \sin \left (\frac {d x}{2}\right )}{d \left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}-\frac {B}{d \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {4 (A+3 B) \sin \left (\frac {d x}{2}\right )}{d \left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}\right )}{32 (B+A \cos (c+d x))} \]
[In]
[Out]
Time = 2.39 (sec) , antiderivative size = 137, normalized size of antiderivative = 1.27
method | result | size |
derivativedivides | \(\frac {a^{3} A \tan \left (d x +c \right )+B \,a^{3} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+3 a^{3} A \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+3 B \,a^{3} \tan \left (d x +c \right )+3 a^{3} A \left (d x +c \right )+3 B \,a^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a^{3} A \sin \left (d x +c \right )+B \,a^{3} \left (d x +c \right )}{d}\) | \(137\) |
default | \(\frac {a^{3} A \tan \left (d x +c \right )+B \,a^{3} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+3 a^{3} A \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+3 B \,a^{3} \tan \left (d x +c \right )+3 a^{3} A \left (d x +c \right )+3 B \,a^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a^{3} A \sin \left (d x +c \right )+B \,a^{3} \left (d x +c \right )}{d}\) | \(137\) |
parallelrisch | \(\frac {\left (-6 \left (1+\cos \left (2 d x +2 c \right )\right ) \left (A +\frac {7 B}{6}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+6 \left (1+\cos \left (2 d x +2 c \right )\right ) \left (A +\frac {7 B}{6}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+6 d \left (A +\frac {B}{3}\right ) x \cos \left (2 d x +2 c \right )+\left (2 A +6 B \right ) \sin \left (2 d x +2 c \right )+A \sin \left (3 d x +3 c \right )+\sin \left (d x +c \right ) \left (A +2 B \right )+6 d \left (A +\frac {B}{3}\right ) x \right ) a^{3}}{2 d \left (1+\cos \left (2 d x +2 c \right )\right )}\) | \(150\) |
risch | \(3 a^{3} A x +a^{3} x B -\frac {i a^{3} A \,{\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {i a^{3} A \,{\mathrm e}^{-i \left (d x +c \right )}}{2 d}-\frac {i a^{3} \left (B \,{\mathrm e}^{3 i \left (d x +c \right )}-2 A \,{\mathrm e}^{2 i \left (d x +c \right )}-6 B \,{\mathrm e}^{2 i \left (d x +c \right )}-B \,{\mathrm e}^{i \left (d x +c \right )}-2 A -6 B \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}-\frac {3 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) A}{d}-\frac {7 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B}{2 d}+\frac {3 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A}{d}+\frac {7 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B}{2 d}\) | \(217\) |
norman | \(\frac {\left (-3 a^{3} A -B \,a^{3}\right ) x +\left (-6 a^{3} A -2 B \,a^{3}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}+\left (3 a^{3} A +B \,a^{3}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}+\left (6 a^{3} A +2 B \,a^{3}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\frac {a^{3} \left (8 A +5 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{d}-\frac {5 B \,a^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{d}-\frac {a^{3} \left (4 A -7 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}-\frac {a^{3} \left (4 A +7 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right ) \left (-1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{3}}-\frac {a^{3} \left (6 A +7 B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 d}+\frac {a^{3} \left (6 A +7 B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 d}\) | \(275\) |
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 137, normalized size of antiderivative = 1.27 \[ \int \cos (c+d x) (a+a \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=\frac {4 \, {\left (3 \, A + B\right )} a^{3} d x \cos \left (d x + c\right )^{2} + {\left (6 \, A + 7 \, B\right )} a^{3} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (6 \, A + 7 \, B\right )} a^{3} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (2 \, A a^{3} \cos \left (d x + c\right )^{2} + 2 \, {\left (A + 3 \, B\right )} a^{3} \cos \left (d x + c\right ) + B a^{3}\right )} \sin \left (d x + c\right )}{4 \, d \cos \left (d x + c\right )^{2}} \]
[In]
[Out]
\[ \int \cos (c+d x) (a+a \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=a^{3} \left (\int A \cos {\left (c + d x \right )}\, dx + \int 3 A \cos {\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int 3 A \cos {\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int A \cos {\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int B \cos {\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int 3 B \cos {\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int 3 B \cos {\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int B \cos {\left (c + d x \right )} \sec ^{4}{\left (c + d x \right )}\, dx\right ) \]
[In]
[Out]
none
Time = 0.22 (sec) , antiderivative size = 165, normalized size of antiderivative = 1.53 \[ \int \cos (c+d x) (a+a \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=\frac {12 \, {\left (d x + c\right )} A a^{3} + 4 \, {\left (d x + c\right )} B a^{3} - B a^{3} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 6 \, A a^{3} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 6 \, B a^{3} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 4 \, A a^{3} \sin \left (d x + c\right ) + 4 \, A a^{3} \tan \left (d x + c\right ) + 12 \, B a^{3} \tan \left (d x + c\right )}{4 \, d} \]
[In]
[Out]
none
Time = 0.33 (sec) , antiderivative size = 192, normalized size of antiderivative = 1.78 \[ \int \cos (c+d x) (a+a \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=\frac {\frac {4 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1} + 2 \, {\left (3 \, A a^{3} + B a^{3}\right )} {\left (d x + c\right )} + {\left (6 \, A a^{3} + 7 \, B a^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - {\left (6 \, A a^{3} + 7 \, B a^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (2 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 5 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 7 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2}}}{2 \, d} \]
[In]
[Out]
Time = 13.69 (sec) , antiderivative size = 207, normalized size of antiderivative = 1.92 \[ \int \cos (c+d x) (a+a \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=\frac {A\,a^3\,\sin \left (c+d\,x\right )}{d}+\frac {6\,A\,a^3\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {6\,A\,a^3\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,B\,a^3\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {7\,B\,a^3\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {A\,a^3\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )}+\frac {3\,B\,a^3\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )}+\frac {B\,a^3\,\sin \left (c+d\,x\right )}{2\,d\,{\cos \left (c+d\,x\right )}^2} \]
[In]
[Out]